<?php
/*
 * @Description: 
 * @Author: Leequik
 * @Date: 2025-07-27 17:18:40
 * @LastEditTime: 2025-07-27 20:52:30
 * @LastEditors: Leequik
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('task_log', function (Blueprint $table) {
            $table->id(); // 主键，自增长，非空
            $table->unsignedInteger('user_id')->default(0); // int not null default 0
            $table->unsignedInteger('company_id')->default(0); // int not null default 0
            $table->string('application_number', 225)->default(''); // string(225) not null default ''
            $table->tinyInteger('status')->default(0); // tinyint not null default 0
            //频次
            $table->unsignedInteger('frequency')->default(0)->comment('频次'); // int not null default 0, 带注释
            $table->unsignedInteger('source_id')->default(0)->comment('来源id'); // int not null default 0, 带注释
            $table->text('request_data')->nullable(); // 可为空
            $table->timestamps(); // created_at 和 updated_at
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('task_log');
    }
};